package kr.hkit.powerjava.chapter06;

public class GuguDanWhile {
	public static void main(String[] args) {
		
//		calGuguDan();
		int dan = 2;
		while(dan < 10) {
			
			calGuguDan(dan);
			dan++;
		}
	}
//	calReverseGuguDan();	
//함수이름은 같으나 매개변수가 다름. 메소드 오버로딩
	
	private static void calGuguDan(int dan) {
		
		int i = 1;
		while (i<10) {
			System.out.printf("%2d *%2d = %2d %n", dan, i, dan*i);
			i = i+1;
		} 	
	}
	
	
/*	private static void calGuguDan(int dan) {  //함수이름은 밑에랑 같으나 매개변수가 다름 (int i)
		int i=1;   
		System.out.println("=======" + dan + "======");
		while (1<10) {
			System.out.printf("%2d *%2d = %2d %n", dan, i, dan*i);
			i++;
		}
	}*/

	/*private static void calReverseGuguDan() {
		int i=9;
		
		while (i>0) {
			System.out.printf("%2d *%2d = %2d %n", 2, i, 2*i);
			i--;
		} // 2단만 계산가능 ㅠㅠ
*/		
	}

